<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta id="viewport" name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,user-scalable=no,target-densitydpi=300">
<title>智能云管家-登录</title>
<script type="text/javascript" src="resources/appMobi-jQ.Mobi-3d025ab/jq.mobi.min.js"></script>
<script src="bi/res/common.js"></script>
<script src="resources/js/cordova-2.1.0.js"></script>

<script src="resources/js/phonegap_login.js"></script>

<script type="text/javascript" src="resources/cubiq-iscroll-a8b8720/src/iscroll.js"></script>
<script type="text/javascript">
$(function(){
    addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); 
      function hideURLbar(){ 
               window.scrollTo(0,1); 
      }
      if(navigator.userAgent.toLowerCase().indexOf("android", 0)<0){
         $("#footer").css({"center;z-index":"999","position":"fixed","bottom":"0"});
         window.scrollTo(0,1); 
        }else{
        $("#footer").css({"position":"fixed","bottom":"0"});
    var top = $("#footer").offset().top;
    if(localStr.indexOf("file:///",0)<0)
	{
	    $(window).scroll(function(){
	    $("#footer").offset({top:$(document).scrollTop()+top});
	    });
	}
        }

       });
var myScroll;
var localStr=window.location.href;
var israndom="no",phone="",key="",porflag=false,biflag=false;
function loaded() {
	myScroll = new iScroll('wrapper', {
		snap: true,
		momentum: false,
		hScrollbar: false,
		onScrollEnd: function () {
			document.querySelector('#indicator > li.active').className = '';
			document.querySelector('#indicator > li:nth-child(' + (this.currPageX+1) + ')').className = 'active';
		}
	 });
}

document.addEventListener('DOMContentLoaded', loaded, false);
document.addEventListener("deviceready", onDeviceReady, false);
function play() {
	if($("#finalDot").hasClass("active")) {
		myScroll.scrollToPage('prev',0);
		myScroll.scrollToPage('prev',0);
		}else{
		myScroll.scrollToPage('next', 0);
		}
	}

$(document).ready(function(e) {
	if(detectDeviceType()=="Apple"){
		$("#viewport").attr("content","width=640,initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5,user-scalable=no");
		
	}
	$("#phoneNo").bind("focus",function(){
	//alert($("#phoneNo").offset().top);
	//window.setTimeout(function(){window.scrollTo(0,$("#phoneNo").offset().top-100);},1000);
	window.setTimeout(function(){window.scrollTo(0,360);},1000);
});
	$("#loading").hide();
	$(".floatBoxBg").hide();
	if(localStr.indexOf("file:///",0)>=0)
	{
		$("body").bind("load",function(){
			init();
		});
	}
	var useragent=navigator.userAgent;
	if(detectDeviceType()=="Apple"){
		$("#phoneNo").get(0).style.width="85%";
		$("#phoneNo").get(0).style.height="50px";
		$("#password").get(0).style.height="50px";
	}
	
	var w=window.screen.width;
	var h=window.screen.height;
	if(h/w>1.6){
		$("#blank1").get(0).style.height="500px";
	}else{
		$("#blank1").get(0).style.height="412px";
	}
	if(useragent.indexOf("Android 4")>0)
	{
		//$("meta").attr("content","width="+w/0.78+", initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5");
	}
	$("#content").get(0).style.height=h;
    setInterval("play()",4000);
    
   	var por_phone=getQueryParameter("phonenum");
	var por_key=getQueryParameter("userkey");
	var bi_key=localStorage.getItem("userkey");
	var bi_phone=localStorage.getItem("curphone");
	if(""!=por_phone && ""!=por_key)
	{
		//alert("phonenum:"+por_phone+",userkey:"+por_key);
		phone=por_phone;
		key=por_key;
		porflag=true;
	}
	if(null!=bi_key && null!=bi_phone)
	{
		phone=bi_phone;
		key=bi_key;
		biflag=true;
	}
	//alert("userkey:"+userkey+",curphone:"+curphone);
	if(porflag || biflag)
	{
		var jsonurl=jsonserver+"bl/autoLogin/"+phone+"/"+key;
		$.getJSON(jsonurl+".jsonp?callback=?",{},function(data){
			
			if(data.sb.status=="00000")
			{
				localStorage.setItem("userkey",key);
				localStorage.setItem("curphone",phone);
				localStorage.setItem("username",data.userName);
				localStorage.setItem("innetTime",data.inNetTime);
				localStorage.setItem("payType",data.payType);//0后付费
				localStorage.setItem("credit",data.credit);
				localStorage.setItem("packname",data.packageName);
				localStorage.setItem("datasDate",data.acctDay);
				window.location.href="bi/index.html";
			}else if(data.sb.status=="00002"){
				localStorage.setItem("userkey",data.userkey);
				localStorage.setItem("curphone",phoneNumber);
				window.location.href="bi/prodata.html";
			}else
			{
				localStorage.clear();
				window.location.href="bilogin.html";
			}
		});
	}

	//TODO透传登陆需要补充,暂时跳过
	
	
	
});
		
		
    	//登陆
   	 	function login1()
		{
		
			
			var phoneNumber=$("#phoneNo").val();
			if(!phoneNumber.match("^1(3[0-2]|5[56]|8[56])\\d{8}$")){
				$("#warning").text("输入手机号码不正确!");
				
				$("#phoneNo").focus();
				return false;
			}
			var password = $("#password").val();
			if($("#password").val().length == 0){
				$("#warning").text("密码不能为空");
				
				$("#password").focus();
				return  false;
			}

		
			var checkurl=jsonserver+"bl/"+phoneNumber+"/"+password+"/yes";
			
			$.getJSON(checkurl+".jsonp?callback=?",{}, function(data) {
					if(data.sb.status=="00000"){
						localStorage.setItem("userkey",data.userkey);
						localStorage.setItem("curphone",phoneNumber);
						localStorage.setItem("username",data.userName);
						localStorage.setItem("innetTime",data.inNetTime);
						localStorage.setItem("payType",data.payType);//0后付费
						localStorage.setItem("credit",data.credit);
						localStorage.setItem("packname",data.packageName);
						localStorage.setItem("datasDate",data.acctDay);
						setTimeout(function(){
							window.location.href="bi/index.html";
						},500);
					}else if(data.sb.status=="00002"){
						localStorage.setItem("userkey",data.userkey);
						localStorage.setItem("curphone",phoneNumber);
						window.location.href="bi/prodata.html";	
					}else{
						$("#warning").text(data.sb.statusDesc);
						return false;
					}
	});
}
	
		function loginshow()
		{
				var offset = $("#finalDot").offset();
				var loadleft=offset.left;
				var loadtop=offset.top;
				var loadimg=$("<img>").attr("src","resources/css/images/loading.gif").css({
						"position":"absolute",
						"left":loadleft+"px",
						"top":loadtop+"px",
						"z-index":"9999"
					});
					$("body").append(loadimg);
					//loadimg.appendTo($("body"));
				$("body").append('<div class="floatBoxBg"></div>');
		}
		//获取随机密码
    	function getpasscode(){
			$("#warning").text("发送中,请稍后..."); 	
			var objlogin_name =  $("#phoneNo").val();
       		 if(!objlogin_name.match("^1(3[0-2]|5[56]|8[56])\\d{8}$")){
				$("#warning").text("输入手机号码不正确!");
				$("#phoneNo").focus();
				return false;
        	}
       		 else
        	{
				var jsonurl=jsonserver+"bl/randomPwd/"+objlogin_name;        
				$.getJSON(jsonurl+".jsonp?callback=?",
					{}, 
					function(data) {
						if(data.sb.status=="00000"){
							$("#warning").text("密码已经发送，请在60分钟内登陆！"); 	
						}else{
							$("#warning").text(data.sb.statusDesc);
							return false;
						}
					});
			}
	
		}
		
		
    

//}
</script>
<style type="text/css" media="all">
body {
	background-color:#F3F3F3
	}
.floatBoxBg{
	width:100%;
	height:300%;
	background:#181e2a;
	filter:alpha(opacity=50);
	opacity:0.5;
	position:absolute;
	top:0;left:0;
	z-index: 999;
	}
#wrapper {
	width: 100%;
	float: left;
	position: relative;	/* On older OS versions "position" and "z-index" must be defined, */
	z-index: 1;			/* it seems that recent webkit is less picky and works anyway. */
	overflow: hidden;
}

#scroller {
	width: 300%;
	height: 100%;
	float: left;
	padding: 0;
}


		.carousel_paging2_selected {
			border-radius: 5px;
			text-align:center;
			background:#666;
			width: 5px;
			height: 5px;
			float: left;
			
		}
    

#scroller ul {
	list-style:none;
	display:block;
	float:left;
	width:100%;
	height:100%;
	padding:0;
	margin:0;
	text-align:left;
}


#scroller li {
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	-o-box-sizing: border-box;
	box-sizing: border-box;
	display: block;
	float: left;
	width: 33.33%;
	padding-left:2px;
	text-align: center;
	font-family: georgia;
	font-size: 24px;
	line-height: 140%;
	color: #f22900;
}

#nav {
	width: 100%;
	float: left;
}

#prev, #next {
	float: left;
	font-weight: bold;
	font-size: 14px;
	padding: 3px 0;
	width: 43.5%;
}

#next {
	float:right;
	text-align:right;
}

#indicator, #indicator > li {
	display:block; float:left;
	list-style:none;
	padding:0; margin:0;
}

#indicator {
	width: 36px;
	height:50px
	padding-top: 10px;
	padding-right: 10px;
	padding-bottom: 0px;
	padding-left: 10px;
	padding-top: 10px;
}

#indicator > li {
	text-indent:-9999em;
	width:8px; height:8px;
	-webkit-border-radius:4px;
	-moz-border-radius:4px;
	-o-border-radius:4px;
	border-radius:4px;
	background:#ddd;
	overflow:hidden;
	margin-right:4px;
	background-image:url(resources/css/images/dian.jpg)
}

#indicator > li.active {
	background-image:url(resources/css/images/dian_on.png)
}

#indicator > li:last-child {
	margin:0;
}
#content {
	height:1150px;
	}
.floatBoxBg{
	width:100%;
	height:300%;
	background:#181e2a;
	filter:alpha(opacity=50);
	opacity:0.5;
	position:absolute;
	top:0;left:0;
	z-index: 999;
	text-align:center;
	vertical-align:central;
	}
    </style>
<style type="text/css">
</style>
<style type="text/css">
*{
	font-family:Heiti SC;
}
</style>
	<script type="text/javascript">
//var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
//document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F2284c04845acdcd94dd640a8555927dc' type='text/javascript'%3E%3C/script%3E"));
</script>
</head>

<body style="margin:0;">

	<div id="header">
<div style="text-align:center; background-image:url(resources/css/images/top_bg.jpg); height:88px; line-height:88px; font-size:40px; color:#1e1e1e">
    智能云管家
    </div>
	</div>
    <div id="content">
    <!--<div id="loading" class="loading"><img src="resources/css/images/loading.gif"/>载入中...</div>
    <div class="floatBoxBg"></div>-->
<div align="center" id="wrapper" style="background-image: url(resources/css/images/black_bg.jpg); background-size:contain">
	<div align="center" id="scroller">
		<ul id="thelist">
			<li>
                <table width="100%" border="0">
                  <tr>
                    <td style="padding-top:15px" rowspan="4" width="44%" align="center"><img src="resources/css/images/login/images/login01.png"/></td>
                    <td style="padding-top:40px"><img src="resources/css/images/login/images/pic01.png"/></td>
                  </tr>
                  <tr>
                    <td style="font-size:40px; color:#FFF; padding-top:20px">流量变化随时掌握</td>
                  </tr>
                  <tr>
                    <td style="padding-top:20px;">还在为不知何时超出的流量而买单吗？</td>
                  </tr>
                  <tr>
                    <td><img src="resources/css/images/pic2_12.png"/></td>
                  </tr>
            </table>
        </li>
			<li><table width="100%" border="0">
  <tr>
    <td style="padding-top:15px" rowspan="4" width="44%" align="center"><img src="resources/css/images/login/images/login03.png"/></td>
    <td style="padding-top:40px"><img src="resources/css/images/login/images/pic02.png"/></td>
  </tr>
  <tr>
    <td style="font-size:40px; color:#FC3; padding-top:20px">套餐智能更换</td>
  </tr>
  <tr>
    <td style="padding-top:20px;">流量超出，短信却用不完，有没有更合适的业务呢？</td>
  </tr>
  <tr>
    <td><img src="resources/css/images/pic2_12.png"/></td>
  </tr>
</table></li>
			<li><table width="100%" border="0">
  <tr>
    <td style="padding-top:15px" rowspan="4" width="44%" align="center"><img src="resources/css/images/login/images/login02.png"/></td>
    <td style="padding-top:40px"><img src="resources/css/images/login/images/pic03.png"/></td>
  </tr>
  <tr>
    <td style="font-size:40px; color:#FFF; padding-top:20px">懂你喜欢</td>
  </tr>
  <tr>
    <td style="padding-top:20px; color:#FC3">好玩、fashion的应用，你喜欢的都在这里啦~~</td>
  </tr>
  <tr>
    <td><img src="resources/css/images/pic2_12.png"/></td>
  </tr>
</table></li>
		</ul>
	</div>
</div>

<div id="nav">
	<div id="prev" onclick="myScroll.scrollToPage('prev', 0);return false"></div>
	<ul id="indicator">
	  <li class="active">1</li>
		<li>2</li>
		<li id="finalDot">3</li>
	</ul>
	<div id="next" onclick="myScroll.scrollToPage('next', 0);return false"></div>
</div>
<div id="blank1" style="width:100%; height:0px"></div>
<div style="width:100%; padding-top:45px" align="center">

  <div style="width:100%; height:94px; line-height:94px"><input type="tel" placeholder="请输入电话号码" style=" border-radius:15px; width:90%; height:62px; font-size:30px" id="phoneNo" onkeyup="value=value.replace(/[^\d]/g,'')" /></div>
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="94px" width="5%">&nbsp;</td>
    <td><input type="password" placeholder="请输验证码或服务密码" style=" border-radius:15px; height:62px; font-size:30px; width:90%;" id="password"/></td>
    <td width="201px"><div style="height:69px; width:201px; background-image:url(bi/res/img/billdet/btnback.png); border-radius:15px; color:#FFF; font-size:32px; line-height:69px; text-align:center" onClick="getpasscode()">获取验证码</div></td>
    <td width="5%">&nbsp;</td>
  </tr>
  <tr height="20">
  	<td colspan="4" style="color:red; font-size:32px;" align="center"><span id="warning"></span></td>
  </tr>
  <tr>
    <td height="94px" width="5%">&nbsp;</td>
    <td colspan="2"><div style="width:100%; height:69px; background-image:url(bi/res/img/billdet/btnback.png); border-radius:15px; color:#FFF; font-size:32px; line-height:69px; text-align:center" onclick="login1()">登录</div></td>
    <td width="5%">&nbsp;</td>
  </tr>
</table>

    </div>
	</div>
<div id="footer">
</div>
    
</body>
</html>
